package com.lanou.horo.zhuizhui.fragment;



import android.os.Bundle;
import android.support.annotation.Nullable;

import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.lanou.horo.zhuizhui.adapter.PicturePageTitleAdapter;
import com.lanou.horo.zhuizhui.R;

public class PicturePageFragment extends Fragment {
    private TabLayout tabLayout;
    private ViewPager viewPager;


	@Override
	@Nullable
	public View onCreateView(LayoutInflater inflater,
			@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.fragment_page_picture, null);
        tabLayout = (TabLayout) view.findViewById(R.id.picturePageTabLayout);
        viewPager = (ViewPager) view.findViewById(R.id.picturePageViewPager);
        return view;
	}

	@Override
	public void onActivityCreated(@Nullable Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
        PicturePageTitleAdapter adapter = new PicturePageTitleAdapter(getFragmentManager());
        viewPager.setAdapter(adapter);
        tabLayout.setupWithViewPager(viewPager);
	}
}
